import request from '@/utiles/request.js'
import store from '@/store'
// 是否搜藏房屋
export const favoritesHouseApi = ({ id }) => {
  return request({
    url: `/user/favorites/${id}`,
    headers: {
      authorization: store.state.token
    }
  })
}
// 收藏房屋
export const favoritesApi = ({ id }) => {
  return request({
    url: `/user/favorites/${id}`,
    headers: {
      authorization: store.state.token
    },
    method: 'POST'
  })
}
// 删除收藏
export const favoritesDelApi = ({ id }) => {
  return request({
    url: `/user/favorites/${id}`,
    headers: {
      authorization: store.state.token
    },
    method: 'DELETE'
  })
}
// 收藏列表
export const favoritesListApi = () => {
  return request({
    url: '/user/favorites',
    headers: { authorization: store.state.token }
  })
}
